﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Library
{
    public partial class DonDatHang
    {
        public DonDatHang(int _maddh, DateTime _ngay, String _tenkh, String _diachi, String _sdt, String _email)
        {
            MaDDH = _maddh;
            Ngay = _ngay;
            TenKH = _tenkh;
            DiaChi = _diachi;
            SoDT = _sdt;
            Email = _email;
        }

        public static List<DonDatHang> GetList()
        {
            return DalDonDatHang.GetList();
        }

        public static List<DonDatHang> FilterList(DateTime from, DateTime to, List<DonDatHang> lst)
        {
            return DalDonDatHang.GetListByNgay(from, to, lst);
        }

        public bool updated = false;

        public void Add()
        {
            this.MaDDH = DalDonDatHang.Add(this);
        }

        public void Update()
        {
            DalDonDatHang.Update(this);
        }

        public void Delete()
        {
            DalDonDatHang.Delete(this);
        }
    }
}
